package com.ruoyi.secondvitim.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.secondvitim.mapper.VitimInformedConsentMapper;
import com.ruoyi.secondvitim.domain.VitimInformedConsent;
import com.ruoyi.secondvitim.service.IVitimInformedConsentService;

/**
 * 第二受害者知情同意书Service业务层处理
 * 
 * @author alonso_ecit
 * @date 2025-10-16
 */
@Service
public class VitimInformedConsentServiceImpl implements IVitimInformedConsentService 
{
    @Autowired
    private VitimInformedConsentMapper vitimInformedConsentMapper;

    /**
     * 查询第二受害者知情同意书
     * 
     * @param id 第二受害者知情同意书主键
     * @return 第二受害者知情同意书
     */
    @Override
    public VitimInformedConsent selectVitimInformedConsentById(Long id)
    {
        return vitimInformedConsentMapper.selectVitimInformedConsentById(id);
    }

    /**
     * 查询第二受害者知情同意书列表
     * 
     * @param vitimInformedConsent 第二受害者知情同意书
     * @return 第二受害者知情同意书
     */
    @Override
    public List<VitimInformedConsent> selectVitimInformedConsentList(VitimInformedConsent vitimInformedConsent)
    {
        return vitimInformedConsentMapper.selectVitimInformedConsentList(vitimInformedConsent);
    }

    /**
     * 新增第二受害者知情同意书
     * 
     * @param vitimInformedConsent 第二受害者知情同意书
     * @return 结果
     */
    @Override
    public int insertVitimInformedConsent(VitimInformedConsent vitimInformedConsent)
    {
        vitimInformedConsent.setCreateTime(DateUtils.getNowDate());
        return vitimInformedConsentMapper.insertVitimInformedConsent(vitimInformedConsent);
    }

    /**
     * 修改第二受害者知情同意书
     * 
     * @param vitimInformedConsent 第二受害者知情同意书
     * @return 结果
     */
    @Override
    public int updateVitimInformedConsent(VitimInformedConsent vitimInformedConsent)
    {
        vitimInformedConsent.setUpdateTime(DateUtils.getNowDate());
        return vitimInformedConsentMapper.updateVitimInformedConsent(vitimInformedConsent);
    }

    /**
     * 批量删除第二受害者知情同意书
     * 
     * @param ids 需要删除的第二受害者知情同意书主键
     * @return 结果
     */
    @Override
    public int deleteVitimInformedConsentByIds(Long[] ids)
    {
        return vitimInformedConsentMapper.deleteVitimInformedConsentByIds(ids);
    }

    /**
     * 删除第二受害者知情同意书信息
     * 
     * @param id 第二受害者知情同意书主键
     * @return 结果
     */
    @Override
    public int deleteVitimInformedConsentById(Long id)
    {
        return vitimInformedConsentMapper.deleteVitimInformedConsentById(id);
    }
}
